import { createApp } from 'vue';
import App from './App.vue';
import { router } from './router';
import { createPinia } from 'pinia';
import lodash from 'lodash'
import VConsole from 'vconsole';
// process.env.NODE_ENV == 'development' &&
// new VConsole();
import 'vant/es/toast/style';
import { showToast } from 'vant';
import { checkValidDate } from './utils/checkValidDate';
import { getUrlParameters, getTimeObj, rules, getStorage, setStorage, convertCent2Dollar, addSpaceToNumber, GetQueryString, getURL } from './utils/index.js'
import 'amfe-flexible';
import timeOut from '@/components/timeOut.vue'
const pinia = createPinia()
const app = createApp(App);
app.component('timeOut', timeOut);
// 全局挂载自定义方法
app.config.globalProperties.$globalFn = {
  getUrlParameters: getUrlParameters,
  getTimeObj: getTimeObj,
  rules: rules,
  getStorage: getStorage,
  setStorage: setStorage,
  convertCent2Dollar: convertCent2Dollar,
  addSpaceToNumber: addSpaceToNumber,
  GetQueryString: GetQueryString,
  checkValidDate: checkValidDate,
  getURL: getURL,
};
app.config.globalProperties.$showToast = showToast;
app.config.globalProperties.$_ = lodash;
// app.config.globalProperties.$message = Toast;
// app.config.globalProperties.$Dialog = Dialog;

// 提供一个变量或方法进行注入
// const message = 'Hello, Message!';
// app.provide('$Toast', Toast);

app.use(router)
  // .use(Icon)
  // .use(Icon)
  // .use(Toast)
  // .use(showToast)
  // .use(Button)
  // .use(ActionSheet)
  .use(pinia)
  .mount('#app');
